package god;

import java.util.Scanner;

public class J13Ex46CalendarV1 {

	public static void main(String[] args) {
		// 0 : 일요일 ~ 6 : 토요일
		int cyear = 2003;
		int what = ((( cyear-1)*365 + (cyear-1)/4 - (cyear-1)/100 + (cyear-1)/400) )% 7;
		System.out.println( cyear + "년 1월 1일의 요일은 " + (what + 1) );
		
		int year = 0;
		int what1 = 0;

		
		Scanner sc = new Scanner(System.in);
		System.out.println( "연도를 입력하세요.");
		year = sc.nextInt();

		what1 = ((( year-1)*365 + (year-1)/4 - (year-1)/100 + (year-1)/400) +1 )% 7;

		
		if (what1 == 7) { what1 = 0; }
		System.out.println(year + "년 1월 1일의 요일은 " + what1 );

		sc.close();
	}

}
